﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true" CodeFile="ResultList.aspx.cs" Inherits="ResultList" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style6
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <br />
    <br />
    <asp:Label ID="TheLoai" runat="server" Text="Label" CssClass="login_text" 
        Font-Bold="True" ForeColor="White"></asp:Label>
    <br />
    <br />   
    <asp:DataList ID="DataSanPham" runat="server" CellPadding="10" 
    RepeatColumns="5">
        <ItemTemplate>
            <table class="style6">
                <tr>
                    <td align="center">
                        <asp:Label ID="TenSanPham" runat="server" Text='<%# Eval("tensanpham") %>' 
                            Font-Bold="True" ForeColor="White" Font-Size="10pt"></asp:Label>
                        
                            <asp:HiddenField ID="Hidden" runat="server" value='<%# Eval("ID") %>' />
                            <% 
                                DataSanPham.EditItemIndex += 1;
                                HiddenField idsanpham = (HiddenField)DataSanPham.Items[DataSanPham.EditItemIndex].Controls[1];

                                int id = int.Parse(idsanpham.Value);
                                DTO.SanPhamDto sanpham = BUS.SanPhamBus.LaySanPhamTheoID(id);
                                int songay = (DateTime.Today - sanpham.NgayNhap).Days;
                                if (songay < 30)
                                {           
                            %>
                                    <img alt="" src='images/new.gif' width='15px' height='15px' />
                            <%  } %>    
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <asp:HyperLink ID="image3" runat="server" 
                        NavigateUrl='<%# "Details.aspx?itemID=" + Eval("ID") %>'><img border="0px" src='<%# Eval("Hinh") %>' width='112px' height='101px' /></asp:HyperLink>
                      
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight: bold" >
                      <% 
                            String type = Request.QueryString["type"];
                            if (type != null)
                            { 
                      %>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("DonGia") + "000VND" %>' Font-Size="8pt" ForeColor="White"></asp:Label>
                      <%    } %>
                      
                      <%
                            else
                            {   
                      %>
                        <asp:Label ID="GiaGoc" runat="server" Text='<%# Eval("DonGia") + ".000 VND" %>' Font-Size="8pt" Font-Strikeout="True" ForeColor="White"></asp:Label>
                        <asp:Label ID="Gia" runat="server" Text='<%# Eval("IDgiamgia")+ ".000 VND"%>' 
                            Font-Bold="True" ForeColor="White" Font-Size="8pt"></asp:Label>
                     <%     } %>  
                        <asp:HyperLink ID="Gio" runat="server" ImageUrl="~/images/index_56.gif" 
                            NavigateUrl='<%# "Cart.aspx?itemID=" + Eval("ID") %>' Height="20px">Gio</asp:HyperLink>
                    </td>
                </tr>
            </table>
            <br />
        </ItemTemplate>
    </asp:DataList>
    <br />
</asp:Content>

